home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / zvt1_11u.lha / ZVT / ExampleScripts / MultiFaxScript.rexx < prev    next >
OS/2 REXX Batch file  |  1995-11-26  |  2KB  |  90 lines

  1. /* FaxScript For MultiFax And ZVT                */
  2.  
  3. options results
  4.  
  5. signal on break_c
  6. signal on halt
  7. signal on syntax
  8.  
  9. options failat 50
  10.  
  11. say "FaxScript For MultiFax And ZVT"
  12.  
  13. /*
  14.  * MultiFax must be running and in a 'quiet' status.
  15.  * The Spooler must be started with the option '-rx' and
  16.  * with automatic answer disabled,
  17.  * and the MFRexx program has to be running.
  18.  *
  19.  * Since I don't know exactly how MultiFax reacts I guessed
  20.  * using 'CommandSer' at this point - I just know that MultiFax relies
  21.  * on a carrier negotiation and I don't know wether MultiFax needs the
  22.  * response of the modem or not.
  23.  */
  24.  
  25. /*
  26.  * Let ZVT establish a connection
  27.  */
  28.  
  29.  address 'ZVT.1' CommandSer "ATA"
  30.  if result="NO CARRIER" then
  31.   do
  32.    setvars(5)
  33.    exit
  34.   end
  35.  
  36. /*
  37.  * ZVT stays inactive, let MultiFax receive a fax
  38.  */
  39.  
  40.  address 'MultiFaxRexx' 'receive 4'
  41.  setvars(0)
  42.  exit
  43.  
  44.  
  45.  
  46.  
  47. /*
  48.  * Maybe I'll put some more sophisticated check here... At this time
  49.  * I have no idea how to check the return values...
  50.  * Up to this point this script does nothing else but receiving the fax.
  51.  */
  52.  
  53. setVars: procedure
  54.     parse arg error
  55.  
  56.     if error=0 then
  57.         do
  58.         address zvt.1 'setlength ' || 1
  59.         address zvt.1 'setname ' || unknown_file
  60.         end
  61.     else        /* No fax here. */
  62.         do
  63.         address zvt.1 'setlength ' || 0
  64.         address zvt.1 'setname no_file'
  65.         end
  66.     return rc
  67.  
  68.  
  69. error:
  70.     call Debug("Error" rc "at line" sigl)
  71.     return rc
  72.  
  73. break_c:
  74. halt:
  75.     call Debug("CTRL_C at line" sigl)
  76.     exit 20
  77.  
  78. syntax:
  79.     call Debug("Syntax error" rc "at line" sigl)
  80.     return rc
  81.  
  82.  
  83. Debug: procedure
  84.     parse arg info
  85.  
  86.     firstLine = sourceline(1)
  87.     parse var firstLine '/*' title '*/'
  88.     say title ':' info
  89.     return
  90.